/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.avbravo.p2cnb;

import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.awt.StatusDisplayer;

/**
 *
 * @author avbravo
 */
public class NBRunnable implements Runnable {

    Sesion sesion = new Sesion();

    @Override
    public void run() {

        try{

             for (int i = 0; i < sesion.getListaTablas().size(); i++) {
            ProgressHandle p = ProgressHandleFactory.createHandle(
                    "Procesando tabla: " + sesion.getListaTablas().get(i)
                    + "     espere....");
            p.start();
            sesion.procesarTabla(sesion.getListaTablas().get(i));
            // break;
            p.finish();
        }
         StatusDisplayer.getDefault().setStatusText("Migración terminada...");
        // p.finish();
        }catch(Exception ex){
            StatusDisplayer.getDefault().setStatusText("Error "+ex.getMessage().toString());
        }

    }
}
